import { Context, Application } from 'egg'

export default (app: Application) => {
  app.logger.info('egg-socket.io middleware app/io/middleware/packet.js')

  return async (ctx: Context, next: () => Promise<any>) => {
    // ctx.logger.info('egg-socket.io middleware packet', ctx.socket.nsp.name, ctx.socket.id, this.packet)
    // ctx.socket.emit('res', 'packet received!')
    await next()
    // ctx.logger.info('egg-socket.io middleware packet done')
  }
}
